PangoFontFace *face;
PangoFontFamily *family;
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated */
GtkWidget *size_list;
GtkWidget *font_list;
GtkWidget *face_list;
gboolean ignore_size;
gboolean ignore_face;
gboolean ignore_font;
-#endif
};
GtkWidget *select_button;
GtkWidget *cancel_button;
-#ifndef GTK_DISABLE_DEPRECATED
+
+ /* Deprecated */
GtkWidget *apply_button;
-#endif
};
static void gtk_font_selection_bootstrap_fontlist (GtkFontSelection *fontsel);
-#ifndef GTK_DISABLE_DEPRECATED
+/* Deprecated */
static void update_font_list_selection (GtkFontSelection *fontsel);
static void update_size_list_selection (GtkFontSelection *fontsel);
static void update_face_model (GtkFontSelection *fontsel,
gboolean first);
-#endif
G_DEFINE_TYPE (GtkFontSelection, gtk_font_selection, GTK_TYPE_VBOX)
gtk_widget_override_font (priv->preview, desc);
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated */
if (priv->size_list)
{
priv->ignore_size = TRUE;
update_size_list_selection (fontsel);
}
-#endif /* GTK_DISABLE_DEPRECATED */
+
+ g_object_notify (G_OBJECT (fontsel), "font-name");
gtk_widget_queue_draw (priv->preview);
-
- g_object_notify (G_OBJECT (fontsel), "font-name");
}
void
priv->ignore_slider = TRUE;
}
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated: just populate the marks in the scale after removal */
if (!priv->_size_model)
{
for (i=0; i<length; i++)
}
g_string_free (size_str, TRUE);
}
-#else
- for (i=0; i<length; i++)
- gtk_scale_add_mark (GTK_SCALE (size_slider),
- (gdouble) sizes[i],
- GTK_POS_BOTTOM, NULL);
-#endif
}
void
gtk_font_selection_ref_family (fontsel, family);
gtk_font_selection_ref_face (fontsel, face);
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated: Remove if clause after removal */
if (fontsel->priv->_font_model)
update_font_list_selection (fontsel);
-#endif
/* Free resources */
g_object_unref ((gpointer)family);
priv = fontsel->priv;
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated: These members will not exist after removal */
priv->size_list = NULL;
priv->font_list = NULL;
priv->face_list = NULL;
priv->ignore_size = FALSE;
priv->ignore_face = FALSE;
priv->ignore_font = FALSE;
-#endif /* GTK_DISABLE_DEPRECATED */
/* Default preview string */
priv->preview_text = g_strdup (pango_language_get_sample_string (NULL));
gtk_font_selection_ref_family (fontsel, NULL);
gtk_font_selection_ref_face (fontsel, NULL);
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated: Remove if clause after removal */
if (fontsel->priv->size_list)
{
g_object_unref (fontsel->priv->size_list);
g_object_unref (fontsel->priv->font_list);
g_object_unref (fontsel->priv->face_list);
}
-#endif
G_OBJECT_CLASS (gtk_font_selection_parent_class)->finalize (object);
}
priv->face = face;
}
-#ifndef GTK_DISABLE_DEPRECATED
+/* Deprecated: All these functions aid deprecated functionality */
static void
populate_font_model (GtkFontSelection *fontsel)
{
cursor_changed_cb (GTK_TREE_VIEW (priv->family_face_list), fontsel);
}
-#endif /* GTK_DISABLE_DEPRECATED */
-
/*****************************************************************************
* These functions are the main public interface for getting/setting the font.
*****************************************************************************/
g_object_notify (G_OBJECT (fontsel), "show-preview-entry");
}
-#ifndef GTK_DISABLE_DEPRECATED
-
/**
* gtk_font_selection_get_family_list:
* @fontsel: a #GtkFontSelection
return priv->preview;
}
-#endif /* GTK_DISABLE_DEPRECATED */
-
/**
* SECTION:gtkfontseldlg
* @Short_description: A dialog box for selecting fonts
priv->cancel_button = gtk_dialog_add_button (dialog,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
-#ifndef GTK_DISABLE_DEPRECATED
+ /* Deprecated: Apply button is not used anymore */
priv->apply_button = gtk_dialog_add_button (dialog,
GTK_STOCK_APPLY,
GTK_RESPONSE_APPLY);
gtk_widget_hide (priv->apply_button);
-#endif
priv->select_button = gtk_dialog_add_button (dialog,
_("Select"),
gtk_dialog_set_alternative_button_order (GTK_DIALOG (fontseldiag),
GTK_RESPONSE_OK,
-#ifndef GTK_DISABLE_DEPRECATED
- GTK_RESPONSE_APPLY,
-#endif
+ GTK_RESPONSE_APPLY, /* Deprecated */
GTK_RESPONSE_CANCEL,
-1);
return fsd->priv->fontsel;
}
-
-/**
- * gtk_font_selection_dialog_get_select_button:
- * @fsd: a #GtkFontSelectionDialog
- *
- * Gets the 'Select' button.
- *
- * Return value: (transfer none): the #GtkWidget used in the dialog
- * for the 'Select' button.
- *
- * Since: 3.2
- */
-GtkWidget *
-gtk_font_selection_dialog_get_select_button (GtkFontSelectionDialog *fsd)
-{
- g_return_val_if_fail (GTK_IS_FONT_SELECTION_DIALOG (fsd), NULL);
-
- return fsd->priv->select_button;
-}
-
-/**
- * gtk_font_selection_dialog_get_cancel_button:
- * @fsd: a #GtkFontSelectionDialog
- *
- * Gets the 'Cancel' button.
- *
- * Return value: (transfer none): the #GtkWidget used in the dialog
- * for the 'Cancel' button.
- *
- * Since: 2.14
- */
-GtkWidget *
-gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog *fsd)
-{
- g_return_val_if_fail (GTK_IS_FONT_SELECTION_DIALOG (fsd), NULL);
-
- return fsd->priv->cancel_button;
-}
-
static void
gtk_font_selection_dialog_buildable_interface_init (GtkBuildableIface *iface)
{
return G_OBJECT (priv->cancel_button);
else if (g_strcmp0 (childname, "font_selection") == 0)
return G_OBJECT (priv->fontsel);
-#ifndef GTK_DISABLE_DEPRECATED
+
+ /* Deprecated */
else if (g_strcmp0 (childname, "ok_button") == 0)
return G_OBJECT (priv->select_button);
else if (g_strcmp0 (childname, "apply_button") == 0)
return G_OBJECT (priv->apply_button);
-#endif
return parent_buildable_iface->get_internal_child (buildable, builder, childname);
}
gtk_font_selection_set_preview_text (GTK_FONT_SELECTION (priv->fontsel), text);
}
-#ifndef GTK_DISABLE_DEPRECATED
/**
* gtk_font_selection_dialog_get_ok_button:
* @fsd: a #GtkFontSelectionDialog
* Return value: (transfer none): the #GtkWidget used in the dialog
* for the 'OK' button.
*
- * Since: 3.2: Use gtk_font_selection_dialog_get_select_button instead.
+ * Deprecated: 3.2
*/
GtkWidget *
gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd)
return fsd->priv->select_button;
}
-#endif /* GTK_DISABLE_DEPRECATED */
+
+/**
+ * gtk_font_selection_dialog_get_cancel_button:
+ * @fsd: a #GtkFontSelectionDialog
+ *
+ * Gets the 'Cancel' button.
+ *
+ * Return value: (transfer none): the #GtkWidget used in the dialog
+ * for the 'Cancel' button.
+ *
+ * Deprecated: 3.2
+ */
+GtkWidget *
+gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog *fsd)
+{
+ g_return_val_if_fail (GTK_IS_FONT_SELECTION_DIALOG (fsd), NULL);
+
+ return fsd->priv->cancel_button;
+}
/* GTK - The GIMP Toolkit
+ * Copyright (C) 2011 Alberto Ruiz <aruiz@gnome.org>
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* GtkFontSelection widget for Gtk+, by Damon Chaplin, May 1998.
* see the comments in the GtkFontSelectionDialog functions.
*****************************************************************************/
-GType gtk_font_selection_get_type (void) G_GNUC_CONST;
+GType gtk_font_selection_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_font_selection_new (void);
PangoFontFamily*
gtk_font_selection_get_family (GtkFontSelection *fontsel);
* GtkFontSelection.
*****************************************************************************/
-GType gtk_font_selection_dialog_get_typei (void) G_GNUC_CONST;
-GtkWidget* gtk_font_selection_dialog_new (const gchar *title);
+GType gtk_font_selection_dialog_get_type (void) G_GNUC_CONST;
+GtkWidget* gtk_font_selection_dialog_new (const gchar *title);
-
-GtkWidget* gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog *fsd);
GtkWidget* gtk_font_selection_dialog_get_font_selection (GtkFontSelectionDialog *fsd);
/* This returns the X Logical Font Description fontname, or NULL if no font
have been loaded OK. You should call gtk_font_selection_dialog_get_font()
to see if it has been loaded OK.
You should g_free() the returned font name after you're done with it. */
-gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
+gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
/* This sets the currently displayed font. It should be a valid X Logical
Font Description font name (anything else will be ignored), e.g.
"-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*"
It returns TRUE on success. */
gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd,
- const gchar *fontname);
+ const gchar *fontname);
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
/* This sets the text in the preview entry. It will be copied by the entry,
so there's no need to g_strdup() it first. */
void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd,
- const gchar *text);
+ const gchar *text);
/* Deprecated GtkFontSelectionDialog methods */
#ifndef GTK_DISABLE_DEPRECATED
-GtkWidget *gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd);
+GtkWidget* gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog *fsd);
+GtkWidget* gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd);
#endif
G_END_DECLS